//
// Lambertian.cpp for  in /home/herpec_j/Dropbox/Projets/raytracer-2016/Sources/BRDFs/
//
// Made by Jonathan
// Login   <ledey_l@epitech.net>
//
// Started on  Wed Sep 25 23:40:34 2013 Jonathan
// Last update Wed Sep 25 23:47:17 2013 Jonathan
//

#include		"BRDFs/Lambertian.hpp"
#include		"Maths/Constants.hpp"

namespace		BRDFs
{
  Lambertian::Lambertian(void) : BRDF(), mKd(0.0), mCd(0.0)
  {
    return;
  }

  Lambertian::Lambertian(Lambertian const &rOther) : BRDF(rOther), mKd(rOther.mKd), mCd(rOther.mCd)
  {
    return;
  }

  Lambertian		&Lambertian::operator=(Lambertian const &rOther)
  {
    if (this != &rOther)
      {
	BRDF::operator=(rOther);
	mKd = rOther.mKd;
	mCd = rOther.mCd;
      }
    return (*this);
  }

  Lambertian		*Lambertian::Clone(void) const
  {
    return (new Lambertian(*this));
  }

  Maths::Color		Lambertian::F(Maths::ShadeRec const &rShadeRec __attribute__((__unused__)), Maths::Vector const &rWo __attribute__((__unused__)), Maths::Vector const &rWi __attribute__((__unused__))) const
  {
    return (mKd * mCd * INVPI);
  }

  Maths::Color		Lambertian::Rho(Maths::ShadeRec const &rShadeRec __attribute__((__unused__)), Maths::Vector const &rWo __attribute__((__unused__))) const
  {
    return (mKd * mCd);
  }

  void			Lambertian::SetKa(long double rKa)
  {
    mKd = rKa;
  }

  void			Lambertian::SetKd(long double rKd)
  {
    mKd = rKd;
  }

  void			Lambertian::SetCd(Maths::Color const &rColor)
  {
    mCd = rColor;
  }

  void			Lambertian::SetCd(long double rR, long double rG, long double rB)
  {
    mCd = Maths::Color(rR, rG, rB);
  }

  void			Lambertian::SetCd(long double rColor)
  {
    mCd = Maths::Color(rColor);
  }

  Lambertian::~Lambertian(void)
  {
    return;
  }
};
